import { React, useEffect, useState } from 'react';
import axios from 'axios';
import avt from './Background_Cliffhouse.jpg';

function DefaultView() {
  const [userInfo, setUserInfo] = useState('');
  const [loginTime, setLoginTime] = useState('');
  useEffect(() => {
    // axios.get('/user').then((res) => {
    //   const { username, loginTime: newLoginTime } = res.data || {}.data;
    //   console.log(res);
    //   setUserInfo(username);
    //   setLoginTime(newLoginTime);
    // }).catch(() => {
    //   // todo
    // });
  }, []);

  return (
    <div style={{ width: '100%', height: '100%' }}>
      {/* <h2 style={{
        fontSize: '24px',
        fontWeight: '700'
      }}
      >
        Hello, 
        {' '}
        <span style={{ fontSize: '48px' }}>{userInfo}</span>
        , 欢迎登录!
      </h2>
      <h3>
        上次登录时间-
        {Date(loginTime)}
      </h3> */}
      <img src={avt} style={{ width: '100%', height: '100%' }} alt="user" />
    </div>
  );
}

export default DefaultView;
